import { createWebHashHistory, createRouter } from "vue-router";
import Home from "./views/Home.vue";
import Doc from "./views/Doc.vue";
import SwitchDemo from "./components/SwitchDemo.vue";
import ButtonDemo from "./components/ButtonDemo.vue";
import TabsDemo from "./components/TabsDemo.vue";
import DialogDemo from "./components/DialogDemo.vue";
import TooltipDemo from "./components/TooltipDemo.vue";
import DividerDemo from "./components/DividerDemo.vue";

import TableDemo from "./components/TableDemo.vue";
import AlertDemo from "./components/AlertDemo.vue";


import { h } from 'vue';
// import Markdown from './components/Markdown.vue';
const history = createWebHashHistory();
// const md = filename => h(Markdown, { path: `../markdown/${filename}.md`, key: filename })
export const router = createRouter({
  history: history,
  routes: [
    { path: "/", component: Home },
    {
      path: "/doc",
      component: Doc,
      children: [
        { path: '/', component: Home },
        // { path: "", redirect: '/Home' },
        { path: "switch", component: SwitchDemo },
        { path: "button", component: ButtonDemo },
        { path: "tabs", component: TabsDemo },
        { path: "dialog", component: DialogDemo },
        { path: "tooltip", component: TooltipDemo },
        { path: "divider", component: DividerDemo },
        { path: "table", component: TableDemo },
        { path: "alert", component: AlertDemo }
      ],
    },
  ],
});
router.afterEach(() => {
  console.log("路由切换了");
});